package e2q.di.domain.manage;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import e2q.web.orm.Persistent;

@Entity
@Table(name = "di_function")
public class Function extends Persistent  {
	private String icon;
	private Long id;
	private String link;
	private String notes;
	private Function parent;
	private String title;
	
	@Column(name = "funcIcon")
	public String getIcon() {
		return icon;
	}
	
	@Id
	@GeneratedValue(generator = "pk")
	@Column(name = "funcId")
	@GenericGenerator(name = "pk", strategy = "e2q.web.orm.IdGenerator")
	public Long getId() {
		return id;
	}

	@Column(name = "funcLink")
	public String getLink() {
		return link;
	}

	@Column(name = "funcNotes")
	public String getNotes() {
		return notes;
	}

	@ManyToOne
	@JoinColumn(name = "funcParentId")
	@NotFound(action = NotFoundAction.IGNORE)
	public Function getParent() {
		return parent;
	}

	@Column(name = "funcTitle")
	public String getTitle() {
		return title;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}
	
	public void setId(Long id) {
		this.id = id;
		
	}
	public void setLink(String link) {
		this.link = link;
	}
	public void setNotes(String notes) {
		this.notes = notes;
	}
	public void setParent(Function parent) {
		this.parent = parent;
	}
	public void setTitle(String title) {
		this.title = title;
	}
}
